<div class="search" >
    <span>选择目的地国家</span>
    <select name="countryID">
      <option value="0">请选择国家</option>
      <foreach name="countryArr" item="country">
      <option value="{$country.id}" <if condition="$countryID eq $country['id'] ">selected</if> >{$country.name}</option>
      </foreach>
    </select>
    <input type="button" class="button-green" value="查  询" onClick="Request()">
    <input type="checkbox" name="schengenCheck" value="1" <if condition="$schengen eq '1' ">checked</if>  >申根签证
</div>

<div class="operate2">
  <ul>
    <li onclick="window.location='{:U(MODULE_NAME.'/Product/visaadd')}'"><span class="icon-add01"></span>添加签证类型</li>
  </ul>
  <div class="clear"></div>
</div>

<table class="list">
		<thead>
  		<tr>
        <th>签证国家</th>
        <th>签证类型</th>
        <th>有效期</th>
        <th>停留时间</th>
        <th>预计工作日</th>
        <th>入境次数</th>
        <th>是否面试</th>
        <th>代理价</th>
        <th>销售价</th>
        <th>操作</th>
      </tr>
		</thead>
    <tbody>
      <foreach name="list" item="vo">
        <tr>
           <td>{$vo.countryName}</td>
           <td>{$vo.name}</td>
           <td>{$vo.validDate}</td>
           <td>{$vo.stopDate}</td>
           <td>{$vo.workDay}天</td>
           <td>{$vo.entryNums}</td>
           <td><if condition="$vo['interviewCheck'] eq '-1' ">不需要<elseif condition="$vo['interviewCheck'] eq '1' " />需要<else />使馆定</if></td>
           <td>{$vo.costPrice}</td>
           <td>{$vo.sellPrice}</td>
           <td>
              <a href="{:U(MODULE_NAME.'/Product/visaedit',array('id' => $vo['id']))}">编辑</a>&nbsp;&nbsp;
              <a href="#">复制</a>&nbsp;&nbsp;
              <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Product/visadel',array('id' => $vo['id']))}', '确实要删除吗？')" >删除</a>
           </td>
        </tr>
     </foreach>
 </tbody>
</table>
<div class="page" style="clear: both;">{$page}</div>
<script type="text/javascript">

  /**
   * [destinationSelect description]
   * @return {[type]} [description]
   */
  function destinationSelect(obj)
  {
    var destinationID = $(obj).val();
    if(destinationID == '0')
    {
      $(obj).nextAll('select').find('option').not('option[value="0"]').remove();
      return;
    }
    $.ajax({
      url: '{:U(MODULE_NAME.'/Product/destinationDataAjax')}',
      type: 'POST',
      dataType: 'json',
      data: {'destinationID': destinationID},
      success:function  (data) {

        $(obj).nextAll('select').find('option').not('option[value="0"]').remove();
        $(obj).next().append(data.destinationChildHtml);

      }
    })
  }

  /**
   * [Request description]
   */
  function Request()
  { 
    var schengen = '0';
    var schengenCheck = $('input[name="schengenCheck"]').is(':checked');

    if(schengenCheck == true){schengen = '1';}
    var url = '';
        url+= '?';
        url+= 'countryID='+$('select[name="countryID"]').val();
        url+= '&schengen='+schengen;
    window.location.href = '/Product/visalist.html'+url;
  }
  
</script>